<template>
  <van-tabbar v-show="!hidden" active-color="#2f318b" v-model="currentTabIndex">
    <van-tabbar-item icon="home-o" @click="$router.push('/business/buy')">
      <span>买币</span>
      <template #icon>
        <van-icon
          :class="currentTabIndex == 0 ? 'icon-bitcoin' : 'icon-bit-coin-line'"
          class="iconfont"
        ></van-icon>
      </template>
    </van-tabbar-item>
    <van-tabbar-item icon="search" @click="$router.push('/business/sell')">
      <span>卖币</span>
      <template #icon>
        <van-icon
          :class="currentTabIndex == 1 ? 'icon-YUAN-circle-fill' : 'icon-YUAN'"
          class="iconfont"
        ></van-icon>
      </template>
    </van-tabbar-item>
    <van-tabbar-item
      :icon="currentTabIndex == 2 ? 'manager' : 'user-o'"
      @click="$router.push('/my')"
      >我的</van-tabbar-item
    >
    <!--<van-tabbar-item icon="service-o" @click="kefu">客服</van-tabbar-item>-->
  </van-tabbar>
</template>

<script>
export default {
  data() {
    return {
      currentTabIndex: 0,
      hidden: false,
    }
  },
  created() {},
  methods: {
    kefu() {
      window.open('http://www.baidu.com')
    },
  },
  watch: {
    '$route.path': {
      immediate: true,
      handler: function(val, old) {
        this.currentTabIndex = this.$route.meta.footer
        if (this.$route.meta.footer === 'hidden') {
          this.hidden = true
        }
      },
    },
  },
}
</script>

<style>
</style>